package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class TestInputStream {

    //读取文件中信息  read()：a)读取并返回字节   b)返回-1表示读取完毕
    public static void main(String[] args) throws IOException {
        //1.创建输入流对象
        InputStream is=new FileInputStream("D:\\a.txt");
        //2.从流中读取数据
        int rs=0;
        while((rs=is.read())!=-1){
             System.out.print((char)rs);
        }
    }
}
